import { service } from '@/service'
const baseUrl='/hbsys-system/organization/admin'


//查询校对列表
export const getFcOrgList = (params?: any) => {
  return service.request({
    url: `${baseUrl}/proofread/list`,
    method: 'GET',
    params
  })
}

//查询审核列表
export const getCheckOrgList = (params?: any) => {
  return service.request({
    url: `${baseUrl}/list`,
    method: 'GET',
    params
  })
}

//查询批注列表
export const getTipList = (id?: any) => {
  return service.request({
    url: `${baseUrl}/annotations/list/${id}`,
    method: 'POST'
  })
}

//提交审核
export const toCheck = (data?: any) => {
  return service.request({
    url: `${baseUrl}/approval`,
    method: 'POST',
    data
  })
}

//校对
export const toJD = (data?: any) => {
  return service.request({
    url: `${baseUrl}/check/singleton`,
    method: 'POST',
    data,
  })
}

//校对导出
export const toJDExcel = (data?: any) => {
  return service.request({
    url: `${baseUrl}/check/singletonio`,
    method: 'POST',
    data,
    responseType: 'blob'
  })
}

// export const soptCheckLedger = (params?: any) => {
//   return service.request({
//     url: `hbsys-system/soptCheck/ledger`,
//     method: 'get',
//     params,
//     responseType: 'blob'
//   })
// }

//年检结果列表
export const checkResult = (data?: any) => {
  return service.request({
    url: `${baseUrl}/result/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
    method: 'POST',
    data
  })
}

//年检审核记录进度详情
export const checkDetailStep = (id?: any) => {
  return service.request({
    url: `${baseUrl}/approval/record/detail/${id}`,
    method: 'POST'
  })
}

//主管单位管理员转派经办人
export const toOperator = (data?: any) => {
  return service.request({
    url: `${baseUrl}/assign`,
    method: 'POST',
    data
  })
}
//查看年检进度
export const getCheckStep = (id?: any) => {
  return service.request({
    url: `${baseUrl}/approval/record/detail/${id}`,
    method: 'POST'
  })
}

//查看年检进度
export const getRecordList = (params?: any) => {
  return service.request({
    url: `${baseUrl}/record/list`,
    method: 'GET',
    params
  })
}

//查看年检进度
export const getGCheckStep = (id?: any) => {
  return service.request({
    url: `${baseUrl}/approval/step/detail/${id}`,
    method: 'POST'
  })
}

//查看未年检
export const getNoCheckList = (data?: any) => {
  return service.request({
    url: `${baseUrl}/result/not/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
    method: 'POST',
    data
  })
}

//导出未参检
export const exportNoCheckList = (data?: any) => {
  return service.request({
    url: `${baseUrl}/result/not/export`,
    method: 'POST',
    data,
    responseType: 'blob'
  })
}

//查看平均办结时间
export const getComTimeList = (params?: any) => {
  return service.request({
    url: `${baseUrl}/completion/time`,
    method: 'GET',
    params
  })
}

//导出办结时间
export const exportComTimeList = (data?: any) => {
  return service.request({
    url: `${baseUrl}/completion/time/export`,
    method: 'POST',
    data,
    responseType: 'blob'
  })
}

export default {
  getFcOrgList, getCheckOrgList, getTipList,
  toCheck, checkResult, checkDetailStep, toOperator, getCheckStep, getRecordList,
  getGCheckStep, toJD, toJDExcel, getNoCheckList, exportNoCheckList,getComTimeList,exportComTimeList
}
  
